import request from '@/utils/request'

// 获取组织架构数据
export function getRoleApi(params) {
  return request({
    url: '/sys/role',
    method: 'get',
    params
  })
}

// 编辑回显请求
export function infoRoleApi(id) {
  return request({
    url: '/sys/role/' + id,
    method: 'get'
  })
}

// 添加
export function addRoleApi(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}

// 修改
export function editRoleApi(data) {
  return request({
    url: '/sys/role/' + data.id,
    method: 'put',
    data
  })
}

// 删除
export function deleteRoleApi(id) {
  return request({
    url: '/sys/role/' + id,
    method: 'delete'
  })
}

//  给角色分配权限
export function assignPerm(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
